//
//  BehindArticleCell.m
//  Movie
//
//  Created by cjy on 16/3/26.
//  Copyright © 2016年 HY. All rights reserved.
//

#import "BehindArticleCell.h"
#import "ModelBehindArticle.h"
#import <UIImageView+WebCache.h>

@implementation BehindArticleCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{


    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        
        
        
        [self createtableView];
        
        
        
    }

    return self;


}

- (void)createtableView{

    self.imageV = [[UIImageView alloc]init];
    [self.contentView addSubview:self.imageV];
    
    
    self.title = [[UILabel alloc]init];
    [self.contentView addSubview:self.title];
    
    self.like = [[UILabel alloc]init];
    [self.contentView addSubview:self.like];
    
    
    self.enjoy = [[UILabel alloc]init];
    [self.contentView addSubview:self.enjoy];

    


}


- (void)layoutSubviews{


    [super layoutSubviews];
    
    self.imageV.frame = CGRectMake(0, 0, self.contentView.frame.size.width/5 *2, 100);

    self.title.frame = CGRectMake(self.contentView.frame.size.width/5 *2 + 10, 10, self.contentView.frame.size.width/5 *3- 10 - 10, 80);

    self.title.textColor = [UIColor whiteColor];
    self.title.font = [UIFont boldSystemFontOfSize:13];

    self.title.numberOfLines = 0;
}


- (void)passModel:(ModelBehindArticle *)model{


    [self.imageV sd_setImageWithURL:[NSURL URLWithString:model.imageV] placeholderImage:[UIImage imageNamed:@"zwt"]];


    self.title.text = model.title;
    

}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
